function getParamByKey(key) {
    var param = location.search;
    param = param.substring(1); // 去掉前面的问号
    var paramArr = param.split("&");
    if(paramArr != null && paramArr.length > 0){
        for(var i = 0;i < paramArr.length;i++){
            var item = paramArr[i];
            var itemArr = item.split("=");
            // key == 目标
            if(itemArr.length == 2 && itemArr[0] == key){
                return itemArr[1]; // 返回value
            }
        }
    }
    return null;
}